<?php
/* 
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/**
 * Description of generarReporteCajaSuccess
 *
 * @author Marcelo
 */

?>
<?php use_stylesheet('/sfPropelPlugin/css/global.css', 'first') ?>
<?php use_stylesheet('/sfPropelPlugin/css/default.css', 'first') ?>



<div id="sf_admin_container">
    <h2>Reporte de Estado de Caja</h2>
    <fieldset><h2>Fecha del Reporte: <?php echo $Fechas?> </h2></fieldset>
<table>
    <thead>
    <th>ITEM</th>
    <th>CATEGORIA</th>
    <th>INGRESO</th>
    <th>EGRESO</th>
    <th>SALDO</th>
    </thead>
    <tbody>
        <?php $e = 1;$total=0;$totalegresos=0;foreach($cierre as $caja):?>
        <tr>
        <td><?php echo $e++ ?></td>
        <td><?php echo $caja->getCategorias()?></td>
        <td  align="right" ><?php echo number_format($caja->getMontoingreso(),0,'','.').' Gs'?></td>
        <td  align="right"><?php echo number_format($caja->getMontoegreso(),0,'','.').' Gs'?></td>
        <td  align="right"><?php echo number_format($caja->getMontosaldo(),0,'','.').' Gs'?></td>
        </tr>
        <?php $total += $caja->getMontoingreso();$totalegresos +=$caja->getMontoegreso(); endforeach; ?>
    </tbody>
    <tfoot>
        <th></th>
        <th><?php   ?></th>
        <th>Total Ingresos: <?php echo number_format($total,0,'','.').' Gs'?></th>
        <th style="color: red">Total Egresos: <?php  echo number_format($totalegresos,0,'','.').' Gs'?></th>
        <th></th>
    </tfoot>
</table>
<?php if(($total-$totalegresos) > 0):?>
    <div class="notice">La CAJA cierra con: <?php  echo number_format($total-$totalegresos,0,'','.').' Gs'?> </div>
 <?php else:?>
    <div class="error">Las CAJA cierra con: <?php  echo number_format($total-$totalegresos,0,'','.').' Gs'?> </div>
 <?php endif;?>
 </div>